﻿using System;
using System.Linq;
using System.Web.UI.WebControls;
using Business;

namespace ServicesDirectory.UserControl
{
    public partial class ServiceDetail3 : System.Web.UI.UserControl
    {


        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        /// <summary>
        /// Loads the reference data.
        /// </summary>
        public void LoadReferenceData()
        {
            cklAccreditations.DataSource = OrganizationBusiness.Instance.GetAccreditation();
            cklAccreditations.DataTextField = "DataRef";
            cklAccreditations.DataValueField = "RefValue";
            cklAccreditations.DataBind();

            cklClientJourney.DataSource = ServiceBusiness.Instance.GetClientJourney();
            cklClientJourney.DataTextField = "DataRef";
            cklClientJourney.DataValueField = "RefValue";
            cklClientJourney.DataBind();


            cklOtherServices.DataSource = ServiceBusiness.Instance.GetOtherService();
            cklOtherServices.DataTextField = "ServiceName";
            cklOtherServices.DataValueField = "ServiceId";
            cklOtherServices.DataBind();

            cklIntervention.DataSource = ServiceBusiness.Instance.GetInterventionAll();
            cklIntervention.DataTextField = "InterventionName";
            cklIntervention.DataValueField = "InterventionId";
            cklIntervention.DataBind();

            cklOutcome.DataSource = ServiceBusiness.Instance.GetClientOutcome();
            cklOutcome.DataTextField = "DataRef";
            cklOutcome.DataValueField = "RefValue";
            cklOutcome.DataBind();

            cklReferralSources.DataSource = ServiceBusiness.Instance.GetReferralSources();
            cklReferralSources.DataTextField = "DataRef";
            cklReferralSources.DataValueField = "RefValue";
            cklReferralSources.DataBind();

            cklSupportCentres.DataSource = ServiceBusiness.Instance.GetSupportCentres();
            cklSupportCentres.DataTextField = "DataRef";
            cklSupportCentres.DataValueField = "RefValue";
            cklSupportCentres.DataBind();


            cklSupportProcess.DataSource = ServiceBusiness.Instance.GetClientSupportProcess();
            cklSupportProcess.DataTextField = "DataRef";
            cklSupportProcess.DataValueField = "RefValue";
            cklSupportProcess.DataBind();

            cklTagetClient.DataSource = ServiceBusiness.Instance.GetTargetClient();
            cklTagetClient.DataTextField = "DataRef";
            cklTagetClient.DataValueField = "RefValue";
            cklTagetClient.DataBind();


            ddlProgramme.DataSource = ProgrammeBusiness.Instance.ShowListProgramme(false);
            ddlProgramme.DataTextField = "ProgrammeName";
            ddlProgramme.DataValueField = "ProgrammeID";
            ddlProgramme.DataBind();
        }


        /// <summary>
        /// Interventions for service edit.
        /// </summary>
        /// <param name="serviceid">The serviceid.</param>
        public void InterventionForServiceEdit(Guid serviceid)
        {
            cklIntervention.DataSource = ServiceBusiness.Instance.GetInterventionAll(serviceid);
            cklIntervention.DataTextField = "InterventionName";
            cklIntervention.DataValueField = "InterventionId";
            cklIntervention.DataBind();
        }

       
    }
}